package com.example.demo.controller;

import com.example.demo.entity.Demo;
import com.example.demo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//@Controller
//@RequestMapping("/demo")
public class DemoController {
//    @Autowired
    DemoService demoService;

//    @RequestMapping("/test")
//    @ResponseBody
    public String test(){
        return "hello ";
    }

//    @RequestMapping("/queryDemo")
//    @ResponseBody
    public Demo queryDemo(Integer id){
        return demoService.queryDemo(id);
    }
}
